package com.hejielife.balking1;

/**
 * 2019年8月2日 下午1:19:48
 * 
 * @author hejielife
 * @despribe SaverThread
 */
public class SaverThread extends Thread {
	private Data data;

	public SaverThread(String name, Data data) {
		super(name);
		this.data = data;
	}

	public void run() {
		try {
			while (true) {
				data.save(); // save
				Thread.sleep(1000); // sleep
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
